package com.skivingcloud.example.feign;

import com.skivingcloud.admin.feignclient.FBasicAuthRequestSysLogService;
import com.skivingcloud.admin.feignclient.FSysLogService;
import com.skivingcloud.admin.sys.entity.SysLog;
import com.skivingcloud.common.utils.ReturnT;
import jakarta.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hushouquan
 */
@RestController
@RequestMapping("/feignTest")
public class FeignTestExampleController{
    protected static final Logger log = LoggerFactory.getLogger(FeignTestExampleController.class);
    
    @Resource
    private FSysLogService sysLogService;
    @Resource
    private FBasicAuthRequestSysLogService basicAuthRequestSysLogService;
    @GetMapping("/getSysLogInfo")
    public ReturnT<String> getSysLogInfo(){
        SysLog sysLogBasicAuthRequest = basicAuthRequestSysLogService.getInfo("011d7357138b43a28ffcc8c8030f0603");
        SysLog sysLog = sysLogService.getInfo("011d7357138b43a28ffcc8c8030f0603");
        log.info("成功调用feign接口普通版{}，自动登录版{}", sysLog, sysLogBasicAuthRequest);
        return ReturnT.ok("成功了");
    }
    
}
